<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Gloze: sequence</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Gloze
   &#160;<span id="projectnumber">1.01-beta2</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="components.html">Schema Components</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">sequence </div>  </div>
</div>
<div class="contents">
<div class="textblock"><p>Compositors like xs:sequence are not represented in OWL because they are primarily concerned with the lexical form of a document. However, they are used to derive restrictions on the cardinality of individual properties appearing within a class. Cardinalities involving xs:sequence are derived by multiplying all nested cardinalities by the minimum and maximum number of occurences of that sequence. By default the minimum and maximum are 1, leaving the nested cardinalities unchanged.</p>
<p>The example below demonstrates this multiplication at work. Element 'foo' has the default cardinality of 1. It's containing sequence has a minimum occurence of 0, so we derive a minimum cardinality of 1*0=0 on 'foo'. From the default maximum (1) we derive a maximum cardinality on 'foo' of 1*1=1. A minimum of 0 is no constraint at all, so only the maximum cardinality restriction appears in the OWL.</p>
<div class="fragment"><pre class="fragment">&lt;?xml version=<span class="stringliteral">&quot;1.0&quot;</span> encoding=<span class="stringliteral">&quot;UTF-8&quot;</span>?&gt;
&lt;xs:schema xmlns:xs=<span class="stringliteral">&quot;http://www.w3.org/2001/XMLSchema&quot;</span>
        targetNamespace=<span class="stringliteral">&quot;http://example.org/&quot;</span> xmlns=<span class="stringliteral">&quot;http://example.org/&quot;</span>
        elementFormDefault=<span class="stringliteral">&quot;qualified&quot;</span>&gt;
        
        &lt;xs:element name=<span class="stringliteral">&quot;foo&quot;</span> /&gt;
        &lt;xs:element name=<span class="stringliteral">&quot;bar&quot;</span> /&gt;
        
        &lt;xs:element name=<span class="stringliteral">&quot;foobar&quot;</span>&gt;
                &lt;xs:complexType&gt;
                        &lt;xs:sequence minOccurs=<span class="stringliteral">&quot;0&quot;</span>&gt;
                                &lt;xs:element ref=<span class="stringliteral">&quot;foo&quot;</span> /&gt;
                                &lt;xs:element ref=<span class="stringliteral">&quot;bar&quot;</span> maxOccurs=<span class="stringliteral">&quot;unbounded&quot;</span>/&gt;
                        &lt;/xs:sequence&gt;
                &lt;/xs:complexType&gt;
        &lt;/xs:element&gt;
        
&lt;/xs:schema&gt;
</pre></div><p>The element 'bar' is a little more interesting, having an unbounded number of occurrences and a default minimum cardinality of 1. The derived maximum cardinality is 1*unbounded=unbounded, and in effect unrestricted. Similarly, the derived minimum cardinality is 0*1=0, also unrestricted. There are therefore no cardinality restrictions on element 'bar'. The, possibly counter-intuitive, result is that 'bar' does not appear in the class definition.</p>
<div class="fragment"><pre class="fragment">@prefix ns2:     &lt;http:<span class="comment">//example.org/def/&gt; .</span>
@prefix rdfs:    &lt;http:<span class="comment">//www.w3.org/2000/01/rdf-schema#&gt; .</span>
@prefix ns1:     &lt;http:<span class="comment">//example.org/&gt; .</span>
@prefix xs_:     &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema#&gt; .</span>
@prefix owl:     &lt;http:<span class="comment">//www.w3.org/2002/07/owl#&gt; .</span>
@prefix xsd:     &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema#&gt; .</span>
@prefix rdf:     &lt;http:<span class="comment">//www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .</span>
@prefix xs:      &lt;http:<span class="comment">//www.w3.org/2001/XMLSchema&gt; .</span>

ns1:bar
      a       rdf:Property .

ns1:foobar
      a       owl:ObjectProperty ;
      rdfs:range
              [ a       owl:Class ;
                rdfs:subClassOf
                        [ a       owl:Restriction ;
                          owl:maxCardinality <span class="stringliteral">&quot;1&quot;</span>^^xsd:int ;
                          owl:onProperty ns1:foo
                        ]
              ] .

ns1:foo
      a       rdf:Property .

&lt;http:<span class="comment">//example.org/sequence.owl&gt;</span>
      a       owl:Ontology .
</pre></div><p>Note that the default type of elements 'foo' and 'bar' is xs:anyType, which is effectively unconstrained hence there are no ranges defined for either property. Also, because xs:anyType is a super-class of xs:anySimpleType, it is unknown whether or not 'foo' and 'bar' are object or datatype properties (or both).</p>
<h2><a class="anchor" id="sequenceChildren"></a>
Child components</h2>
<ul>
<li><a class="el" href="element.html">element</a></li>
<li><a class="el" href="choice.html">choice</a></li>
<li><a class="el" href="sequence.html">sequence</a></li>
<li><a class="el" href="any.html">any</a></li>
<li><a class="el" href="group.html">group</a> </li>
</ul>
</div></div>


<hr class="footer"/><address class="footer"><small>
Generated on Tue Nov 15 2011 22:13:50 for Gloze by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
